<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>测试页面1</title>
</head>
<body>

<!-- 设置普通文本 -->
    <div th:text="${ msg }"></div>

<!-- 设置html代码-->
    <div th:utext="${ html }"></div>

<!-- 设置value值 -->
    <input type="text" name="username" th:value="${ username }" >

<!-- if判断 -->
    <div th:if="${ msg1 eq 'hello' }">msg的值为hello</div>

<!-- 遍历数组 -->
    <li th:each="name : ${ array }" th:text="${ name }"></li>

<!-- 遍历对象集合 -->
<table border="1" cellpadding="5" cellspacing="0">
    <tr>
        <th>ID</th>
        <th>用户名</th>
        <th>密码</th>
    </tr>
    <tr th:each="user : ${ userList }">
        <td th:text="${ user.id }"></td>
        <td th:text="${ user.username}"></td>
        <td th:text="${ user.password}"></td>
    </tr>
</table>
</body>
</html>